<?php
if (! isLogined()) {
    header("Location: index.php?mod=login&tip=1");
    die();
}
$mod = get_get("mod");
if ($mod == "") {
    header("Location: admin.php?mod=general");
    die();
}
global $_G;
$_G["admincp"]["mod"] = $mod;
if (! $_G["permissions"]["isAdmin"]) {
    printMessage("error", "你不是管理员，无权访问站点管理界面");
    die();
}
if (! isAjaxRequest()) {
    loadTemp("admin/admin_farme.php");
} else {
    $file = dirname(__FILE__). "/module/$mod/$mod" . "_entry.php";
    if (file_exists($file)) {
        require_once $file;
        die();
    }
    printMessage("error", "无效的请求模块$mod , $file");
    die();
}
?>